{extend name="public/father" /}

{block name='main'}
<div class="layui-card">
    <div class="layui-card-header">短视频管理</div>
    <div class="layui-card-body">

        <blockquote class="layui-elem-quote layui-quote-nm">
            <p>前端路径：http://你的域名/item/dsp/share_img</p>
            <p>例如：http://qun3.fission.video/item/dsp/share_img</p>
        </blockquote>

        <div class="layui-btn-container">
            <button class="layui-btn" onclick="openUrl('添加', 'create', 800);return false;"><i class="layui-icon layui-icon-addition"></i>生成二维码</button>
            <button class="layui-btn layui-btn-primary" onclick="javascript:location.reload();"><i class="layui-icon layui-icon-ok-circle"></i> 刷新</button>
        </div>

        <table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>

        <script type="text/html" id="status">
            {{ d.status==1 ? '已启用' : '<span style="color: orange;">已禁用</span>' }}
        </script>

        <script type="text/html" id="img">
            <img onclick="showImg(this.src);" src="{{ d.img }}" style="max-width: 100%;" alt="">
        </script>

        <script type="text/html" id="rukou">
            <div class="layui-btn-group">
                <a class="layui-btn layui-btn-sm layui-btn-primary" href="{{ d.url }}" target="_blank"><i class="layui-icon layui-icon-link"></i>打开</a>
                <a class="layui-btn layui-btn-sm layui-btn-primary" onclick="showImg('qrcode?url={{ d.url }}')"><i class="layui-icon layui-icon-chart"></i>二维码</a>
                <a class="layui-btn layui-btn-sm layui-btn-primary" onclick="layer.alert('{{ d.url }}', {title: false,shade: 0.5,closeBtn: 1,shadeClose: true,anim: 3,btn:false});"><i class="layui-icon layui-icon-search"></i>网址</a>
            </div>
        </script>

        <script type="text/html" id="status">
            {{ d.status==1 ? '已启用' : '<span style="color: orange;">已禁用</span>' }}
        </script>

        <script type="text/html" id="barDemo">
            <div class="layui-btn-group">
                <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>修改</a>
                <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="del" data-table="qrcodes"><i class="layui-icon layui-icon-delete"></i>删除</a>
            </div>
        </script>

    </div>
</div>
{/block}


{block name="js"}
<script>
    layui.use(['table', 'layer', 'form'], function() {
        var table = layui.table,
            layer = layui.layer,
            form = layui.form,
            $ = layui.jquery;

        table.render({
            elem: '#dataTable',
            url: "{:url()}",
            title: '数据表',
            size: 'lg',
            limit: 20,
            cols: [
                [
                    {field: 'left',		title:'操作',	width:160,	align:'center',	toolbar:'#barDemo'},
                    {field: 'rukou',	title:'入口网址',	width:240,	align:'center',	templet:'#rukou'},
                    {field: 'status',	title:'状态',	width:100,	align:'center',	templet:'#status',	sort:true},
                    {field: 'url',		title:'网址',	minWidth:200,					                sort:true},
                    {field: 'img',		title:'图片',	width:150,	align:'center',	templet:'#img'},
                    {field: 'view',		title:'访问量',	width:100,	align:'center',                 	sort:true},
                {field: 'create_time',	title:'创建时间',	width:170,	align:'center',	sort:true},
                {field: 'update_time',	title:'更新时间',	width:170,	align:'center',	sort:true},
                ]
            ],
            page: true
        });

    });
</script>
{/block}
